export class BaseResponse {
  code?: number
  msg?: string

  isSuccess(): boolean {
    if (typeof this.code === 'string') {
      return parseInt(this.code) === 200
    }
    return this.code === 200
  }
}

export class ApiResponse<T> extends BaseResponse {
  dataset?: T
  constructor(dataset: T) {
    super()
    this.dataset = dataset
  }
}
